package com.asia5b.a5mall.order.adapter

import android.widget.LinearLayout
import android.widget.TextView
import com.asia5b.a5mall.middleware.model.member.HouseModel
import com.asia5b.a5mall.order.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/3/7.
 */
class OrderListHouseAdapter(list: ArrayList<HouseModel>) :
        BaseQuickAdapter<HouseModel, BaseViewHolder>(R.layout.item_orderlist_type_adapter, list) {
    var currentHouse: HouseModel? = null
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun convert(helper: BaseViewHolder, item: HouseModel) {
        val ll_orderlist_typename_vessel = helper.getView<LinearLayout>(R.id.ll_orderlist_typename_vessel)
        val tv_orderlist_typename = helper.getView<TextView>(R.id.tv_orderlist_typename)
        ll_orderlist_typename_vessel.isSelected = currentHouse?.id == item.id
        tv_orderlist_typename.text = item.house_name

    }
}